<template>
	<view class="pay-pages">
		<view class="info-block">
			<image :src="imgStorage+'/login/success.png'" class="result-img"></image>
			<view class="title">缴费成功</view>
			<uni-table border stripe emptyText="-">
				<uni-tr>
					<uni-th align="center" width="170">类目</uni-th>
					<uni-th align="center" width="170">欠费缴纳</uni-th>
				</uni-tr>
				<uni-tr v-if="rentArrears">
					<uni-td align="center">房租欠费</uni-td>
					<uni-td align="center">{{rentArrears}}元（{{rentMonthsBetween}}月）</uni-td>
				</uni-tr>
				<uni-tr v-if="lateFee">
					<uni-td align="center">滞纳金</uni-td>
					<uni-td align="center">{{lateFee}}元（{{propertyFeeArrears}}天）</uni-td>
				</uni-tr>
				<uni-tr v-if="propertyFeeArrears">
					<uni-td align="center">物业费欠费</uni-td>
					<uni-td align="center">{{propertyFeeArrears}}元（{{propertyMonthsBetween}}月）</uni-td>
				</uni-tr>
				<uni-tr>
					<uni-td align="center">合计金额</uni-td>
					<uni-td align="center">{{totalPrice}}元</uni-td>
				</uni-tr>
			</uni-table>
			<view class="btn normal" @click="navigate('/page_pack/rent_payment/info')">去缴纳房租</view>
			<view class="btn-block">
				<view class="btn-title">其他服务</view>
				<view class="btn-item">
					<view class="small-btn cancel" @click="switchTab">返回首页</view>
					<view class="small-btn cancel" @click="navigate('/page_pack/my_pages/pay_record/rent')">查看缴费记录
					</view>
					<view class="small-btn cancel " @click="navigate('/page_pack/my_pages/pay_record/receipt')">
						<view class="iconfont icon-xiazai"></view>下载收据
					</view>
				</view>
			</view>

		</view>
		<view class="invoice">若开具发票，点击申请</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				rentArrears: '', //房租欠费
				rentMonthsBetween: '', //房租欠费时间（月）
				lateFee: '', //滞纳金
				newDaysBetween: '', //滞纳时间（天）
				propertyFeeArrears: '', //物业欠费
				propertyMonthsBetween: '', //物业欠费时间（月）
				totalPrice: 0
			}
		},
		methods: {

		},
		onLoad(e) {
			console.log(e)
			this.rentArrears = e.rentArrears
			this.lateFee = e.lateFee
			this.newDaysBetween = e.newDaysBetween
			this.propertyFeeArrears = e.propertyFeeArrears
			this.rentMonthsBetween = e.rentMonthsBetween
			this.propertyMonthsBetween = e.propertyMonthsBetween
			this.totalPrice = e.totalPrice
		}
	}
</script>

<style lang="scss" scoped>
	.pay-pages {
		height: 100vh;
		width: 100%;
		background-color: #ffffff;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		padding: 30rpx;
		align-items: center;

		.info-block {
			width: 100%;
			min-height: 75vh;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;

			.result-img {
				width: 260rpx;
				height: 260rpx;
			}

			.title {
				font-size: 34rpx;
				font-weight: bold;
				margin-top: 40rpx;
				margin-bottom: 40rpx;
			}

			.btn-block {
				margin-top: 50rpx;
				width: 100%;
				background-color: #fff;
				padding: 30rpx;
				border-radius: 20rpx;

				.btn-title {
					font-weight: bold;
					font-size: 32rpx;
					margin-bottom: 20rpx;
				}

				.btn-item {
					display: flex;
					align-items: center;
					justify-content: space-between;

					.small-btn {
						width: 200rpx;
						height: 90rpx;
						font-size: 28rpx;
						border-radius: 10px;

						.iconfont {
							margin-right: 20rpx;
							font-size: 34rpx;
						}
					}
				}
			}

			.btn {
				width: 100%;
				border-radius: 20rpx;
				margin-top: 30rpx;
				height: 90rpx;
				font-size: 30rpx;
			}
		}

		.invoice {
			color: $theme-color;
			font-size: 28rpx;
			margin-bottom: 30rpx;
		}
	}
</style>